<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--5.两个输入框，一个符号，计算按钮，加减乘除-->
	</head>
	<body>
		<input type="text" id="zhi1"/>
		<select id="fuhao">
			<option></option>
			<option>+</option>
			<option>-</option>
			<option>*</option>
			<option>/</option>
			
			
		</select>
		<input type="text" id="zhi2"/>
		<input type="button" value="提交" onclick="jisuan()" />
	</body>
	<script type="text/javascript">
		function jisuan(){
			if(document.getElementById('fuhao').value==''){
				alert('请选择符号');
			}
			else if(document.getElementById('zhi1').value=='' || document.getElementById('zhi2').value==''){
				alert('值未输入')
			}
			else if(document.getElementById('fuhao').value=='+'){
						a=Number(document.getElementById('zhi1').value) + Number(document.getElementById('zhi2').value);
						alert(a);
			}
			else if(document.getElementById('fuhao').value=='-'){
						a=Number(document.getElementById('zhi1').value) - Number(document.getElementById('zhi2').value);
						alert(a);
			}
			else if(document.getElementById('fuhao').value=='*'){
						a=Number(document.getElementById('zhi1').value) * Number(document.getElementById('zhi2').value);
						alert(a);
			}
			else if(document.getElementById('fuhao').value=='/'){
						a=Number(document.getElementById('zhi1').value) / Number(document.getElementById('zhi2').value);
						alert(a);
			}
		}
	</script>
</html>
